﻿<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" isELIgnored="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>商品信息修改</title>
	<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css">
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.8.3.min.js"></script>
	<script>
		function showa(){
			alert("修改完成！");
		}
	</script>
</head>
<body>
<c:if test="${not empty product}">
	<div class="main">
		<div class="optitle clearfix">
			<div class="title">商品管理 &gt;&gt; 修改商品信息</div>
		</div>
		<form id="form1" name="form1" method="post" action="${pageContext.request.contextPath}/product/update">
			<input type="hidden" name="method" value="update">
			<div class="content">
				<table class="box">
					<tbody>
					<tr>
						<td class="field">商品编号：</td>
						<input type="hidden" name="productID" value="${product.productID}">
						<td>${product.productID}</td>
					</tr>
					<tr>
						<td class="field">商品名称：</td>
						<td>
							<input type="text" name="productName" class="text" id="productName" value="${product.productName}">
							<span style="color:red">*</span>
							<span style="color:red" id="productname_span"></span>
						</td>
					</tr>
					<tr>
						<td class="field">商品类型：</td>
						<input type="hidden" name="category" value="${product.category}">
						<td>${product.category}</td>
					</tr>
					<tr>
						<td class="field">供应商：</td>
						<td>
							<select name="supplier" id="supplier">
								<c:forEach items="${supplier}" var="s">
									<option value="${s.supplierName}" <c:if test="${product.supplier == s.supplierName }" >selected</c:if>>${s.supplierName}</option>
								</c:forEach>
							</select>
						</td>
					</tr>
					<tr>
						<td class="field">商品单价：</td>
						<td>
							<input type="text" name="unitPrice" class="text" id="unitPrice" value="${product.unitPrice}">
							<span style="color:red">*</span>
							<span style="color:red" id="price_span"></span>
						</td>
					</tr>
					<tr>
						<td class="field">商品库存：</td>
						<td>
							<input type="text" name="currentStock" class="text" id="currentStock" value="${product.currentStock}">
							<span style="color:red">*</span>
							<span style="color:red" id="stock_span"></span>
						</td>
					</tr>
					<tr>
						<td class="field">商品条码：</td>
						<td>
							<input type="text" name="barcode" class="text" id="barcode" value="${product.barcode}">
							<span style="color:red">*</span>
							<span style="color:red" id="barcode_span"></span>
						</td>
					</tr>
					</tbody>
				</table>
			</div>
			<div class="buttons">
				<input type="submit" name="update" id="update" value="修改" class="input-button" onclick="showa()">
				<input type="button" name="button" id="button" onclick="history.back(-1)" value="返回" class="input-button">
			</div>
		</form>
	</div>
</c:if>

<script type="text/javascript" src="${pageContext.request.contextPath}/js/user/update.js"></script>
</body>
</html>